/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package eu.marc.juliator.gui.peptideprotein;

import com.compomics.util.Util;
import com.compomics.util.experiment.biology.Enzyme;
import com.compomics.util.experiment.biology.EnzymeFactory;
import com.compomics.util.experiment.identification.SequenceFactory;
import com.compomics.util.experiment.identification.matches.ProteinMatch;
import com.compomics.util.experiment.identification.protein_inference.proteintree.ProteinTree;
import com.compomics.util.general.ExceptionHandler;
import com.compomics.util.gui.waiting.waitinghandlers.ProgressDialogX;
import com.compomics.util.preferences.UtilitiesUserPreferences;
import eu.marc.juliator.gui.JuliatorGUI;
import eu.marc.juliator.gui.io.InputFile;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.RandomAccessFile;
import java.io.Writer;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
import javax.swing.filechooser.FileFilter;

/**
 * panel displaying the peptide to protein matching
 *
 * @author Marc
 */
public class PeptideProteinPanel extends javax.swing.JPanel {

    /**
     * The main gui
     */
    private JuliatorGUI juliatorGUI;
    /**
     * The input file
     */
    private InputFile inputFile = null;
    /**
     * The column separator
     */
    private String separator = "\t";
    /**
     * The protein sequence factory
     */
    private SequenceFactory sequenceFactory = SequenceFactory.getInstance(100000);
    /**
     * The protein tree used for protein inference
     */
    private ProteinTree proteinTree;
    /**
     * A simple progress dialog.
     */
    private ProgressDialogX progressDialog;
    /**
     * The utilities user preferences.
     */
    private UtilitiesUserPreferences utilitiesUserPreferences = null;

    /**
     * Creates new form PeptideProteinPanel
     */
    public PeptideProteinPanel(JuliatorGUI juliatorGUI) {
        this.juliatorGUI = juliatorGUI;
        initComponents();
        initGUI();
        loadUserPreferences();
    }

    /**
     * Initiates the gui
     */
    private void initGUI() {
        separatorTxt.setText(separator.replace("\\", "\\\\"));
    }

    /**
     * lets the user chose an input file
     */
    private File getInputFile() {
        File startLocation = juliatorGUI.getLastSelectedFolder();
        JFileChooser fc = new JFileChooser(startLocation);
        fc.setFileSelectionMode(JFileChooser.FILES_ONLY);
        fc.setMultiSelectionEnabled(false);
        int result = fc.showOpenDialog(this);
        if (result == JFileChooser.APPROVE_OPTION) {
            File file = fc.getSelectedFile();
            juliatorGUI.setLastSelectedFolder(file.getParentFile());
            return file;
        }
        return null;
    }

    /**
     * Loads the user preferences.
     */
    public void loadUserPreferences() {
        try {
            utilitiesUserPreferences = UtilitiesUserPreferences.loadUserPreferences();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * lets the user chose a fasta file
     */
    private File getFastaFile() {
        File startLocation = juliatorGUI.getLastSelectedFolder();
        if (utilitiesUserPreferences.getDbFolder() != null && utilitiesUserPreferences.getDbFolder().exists()) {
            startLocation = utilitiesUserPreferences.getDbFolder();
        }
        JFileChooser fc = new JFileChooser(startLocation);
        fc.setFileSelectionMode(JFileChooser.FILES_ONLY);
        fc.setMultiSelectionEnabled(false);
        FileFilter filter = new FileFilter() {
            @Override
            public boolean accept(File myFile) {

                return myFile.getName().toLowerCase().endsWith(".fasta")
                        || myFile.isDirectory();
            }

            @Override
            public String getDescription() {
                return "Protein database (.fasta)";
            }
        };
        fc.setFileFilter(filter);
        int result = fc.showOpenDialog(this);
        if (result == JFileChooser.APPROVE_OPTION) {
            File file = fc.getSelectedFile();
            juliatorGUI.setLastSelectedFolder(file.getParentFile());
            return file;
        }
        return null;
    }

    /**
     * Returns a user selected file
     *
     * @return file selected by the user for export
     */
    private File getExportFile() {
        File startLocation = juliatorGUI.getLastSelectedFolder();
        JFileChooser fc = new JFileChooser(startLocation);
        fc.setFileSelectionMode(JFileChooser.FILES_ONLY);
        fc.setMultiSelectionEnabled(false);
        int result = fc.showOpenDialog(this);
        if (result == JFileChooser.APPROVE_OPTION) {
            File file = fc.getSelectedFile();
            if (!file.getName().endsWith(".txt")) {
                file = new File(file.getParent(), file.getName() + ".txt");
            }
            return file;
        }
        return null;
    }

    /**
     * starts the input process
     */
    private void editInputClicked() {
        File selectedFile = getInputFile();
        if (selectedFile != null) {
            peptideFileTxt.setText(Util.getFileName(selectedFile));
            try {
                inputFile = new InputFile(selectedFile, separator);
                inputTable.setModel(new InputTableModel(inputFile));
                updateMatchingTable();
            } catch (Exception e) {
                e.printStackTrace();
                JOptionPane.showMessageDialog(this, "An error occurred while processing the input.",
                        "File Error", JOptionPane.INFORMATION_MESSAGE);
            }
        }
    }

    /**
     * Import the protein sequences and matches the peptides onto them
     */
    private void editDBClicked() {
        File fastaFile = getFastaFile();
        if (fastaFile != null) {
            try {
                sequenceFactory.clearFactory();
                sequenceFactory.loadFastaFile(fastaFile);
                progressDialog = new ProgressDialogX(juliatorGUI,
                        null,
                        null,
                        true);
                progressDialog.setTitle("Indexing database. Please Wait...");
                progressDialog.setPrimaryProgressCounterIndeterminate(true);
                progressDialog.setUnstoppable(false);

                new Thread(new Runnable() {
                    public void run() {
                        try {
                            progressDialog.setVisible(true);
                        } catch (IndexOutOfBoundsException e) {
                            // ignore
                        }
                    }
                }, "ProgressDialog").start();

                new Thread("IndexingThread") {
                    @Override
                    public void run() {
                        try {
                            proteinTree = sequenceFactory.getDefaultProteinTree(progressDialog);
                            updateMatchingTable();
                            // close the progress dialog
                            if (!progressDialog.isRunCanceled()) {
                                progressDialog.setRunFinished();
                            }
                        } catch (Exception e) {
                            e.printStackTrace();
                            progressDialog.dispose();
                            juliatorGUI.catchException(e);
                        }
                    }
                }.start();

                jTextField1.setText(fastaFile.getName());

            } catch (Exception e) {
                e.printStackTrace();
                JOptionPane.showMessageDialog(this, "An error occurred while processing the database.",
                        "File Error", JOptionPane.INFORMATION_MESSAGE);
            }
        }
    }

    /**
     * Returns the selected column number
     *
     * @return the selected column number
     */
    private int getColumnNumber() {
        return (Integer) columnSpinner.getValue();
    }

    /**
     * Returns the selected number of amino acids
     *
     * @return the selected number of amino acids
     */
    private int getNAA() {
        return (Integer) aaSpinner.getValue();
    }

    /**
     * Returns the ms2 tolerance as set by the user.
     *
     * @return the ms2 tolerance as set by the user
     */
    private double getMs2Tolerance() {
        return new Double(ms2ToleranceTxt.getText());
    }

    /**
     * Update the matching table if all needed input is present
     */
    private void updateMatchingTable() {
        if (inputFile != null && proteinTree != null) {
            try {
                matchingTable.setModel(new ProteinTableModel(inputFile, getColumnNumber(), getNAA(), proteinTree, getMatchingType(), getMs2Tolerance()));
            } catch (Exception e) {
                e.printStackTrace();
                JOptionPane.showMessageDialog(this, "An error occurred while processing the input.",
                        "File Error", JOptionPane.INFORMATION_MESSAGE);
            }

        }
    }

    /**
     * Exports the results in a text file
     */
    private void exportMatches() {
        final File exportFile = getExportFile();
        if (exportFile != null) {
            try {
                progressDialog = new ProgressDialogX(juliatorGUI,
                        null,
                        null,
                        true);
                progressDialog.setTitle("Exporting results. Please Wait...");
                progressDialog.setPrimaryProgressCounterIndeterminate(true);
                progressDialog.setUnstoppable(false);

                new Thread(new Runnable() {
                    public void run() {
                        try {
                            progressDialog.setVisible(true);
                        } catch (IndexOutOfBoundsException e) {
                            // ignore
                        }
                    }
                }, "ProgressDialog").start();

                new Thread("IndexingThread") {
                    @Override
                    public void run() {

                        try {
                            BufferedWriter proteinWriter = new BufferedWriter(new FileWriter(exportFile));
                            try {
                                MappingExporter.exportResults(inputFile, getColumnNumber(), getNAA(), proteinTree, proteinWriter, separator, progressDialog, getMatchingType(), getMs2Tolerance());
                            } finally {
                                proteinWriter.close();
                            }
                            // close the progress dialog
                            if (!progressDialog.isRunCanceled()) {
                                progressDialog.setRunFinished();
                                JOptionPane.showMessageDialog(PeptideProteinPanel.this, "Export finished.",
                                        "Export Finished", JOptionPane.INFORMATION_MESSAGE);
                            }
                        } catch (Exception e) {
                            e.printStackTrace();
                            JOptionPane.showMessageDialog(PeptideProteinPanel.this, "An error occurred while exporting the results.",
                                    "Export Error", JOptionPane.INFORMATION_MESSAGE);
                            progressDialog.dispose();
                            juliatorGUI.catchException(e);
                        }
                    }
                }.start();
            } catch (Exception e) {
                juliatorGUI.catchException(e);
                JOptionPane.showMessageDialog(this, "An error occurred while exporting the results.",
                        "Export Error", JOptionPane.INFORMATION_MESSAGE);
            }
        }
    }

    /**
     * Closes all conections
     */
    public void close() {
        if (inputFile != null) {
            try {
                inputFile.close();
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        if (sequenceFactory != null) {
            try {
                sequenceFactory.closeFile();
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }

    /**
     * Returns the type of matching to be used for peptide to protein matching.
     *
     * @return the type of matching to be used for peptide to protein matching
     */
    public ProteinMatch.MatchingType getMatchingType() {
        return ProteinMatch.MatchingType.indistiguishibleAminoAcids;
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jSeparator1 = new javax.swing.JSeparator();
        jLabel3 = new javax.swing.JLabel();
        columnSpinner = new javax.swing.JSpinner();
        jLabel4 = new javax.swing.JLabel();
        aaSpinner = new javax.swing.JSpinner();
        jButton1 = new javax.swing.JButton();
        jLabel5 = new javax.swing.JLabel();
        separatorTxt = new javax.swing.JTextField();
        jSplitPane1 = new javax.swing.JSplitPane();
        jPanel1 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        inputTable = new javax.swing.JTable();
        jLabel1 = new javax.swing.JLabel();
        editPeptideFileButton = new javax.swing.JButton();
        peptideFileTxt = new javax.swing.JTextField();
        jPanel2 = new javax.swing.JPanel();
        jScrollPane2 = new javax.swing.JScrollPane();
        matchingTable = new javax.swing.JTable();
        jLabel2 = new javax.swing.JLabel();
        editProteinFileButton = new javax.swing.JButton();
        jTextField1 = new javax.swing.JTextField();
        jLabel6 = new javax.swing.JLabel();
        ms2ToleranceTxt = new javax.swing.JTextField();
        jLabel7 = new javax.swing.JLabel();

        jLabel3.setText("Column:");

        columnSpinner.setModel(new javax.swing.SpinnerNumberModel(Integer.valueOf(1), Integer.valueOf(1), null, Integer.valueOf(1)));
        columnSpinner.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                columnSpinnerMouseReleased(evt);
            }
        });

        jLabel4.setText("# AA:");

        aaSpinner.setModel(new javax.swing.SpinnerNumberModel(Integer.valueOf(10), Integer.valueOf(0), null, Integer.valueOf(1)));
        aaSpinner.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                aaSpinnerMouseReleased(evt);
            }
        });

        jButton1.setText("Export");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jLabel5.setText("Separator:");

        separatorTxt.setEditable(false);
        separatorTxt.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
        separatorTxt.setText("test");
        separatorTxt.setToolTipText("");
        separatorTxt.setEnabled(false);

        jSplitPane1.setDividerLocation(391);
        jSplitPane1.setDividerSize(1);

        inputTable.setModel(new InputTableModel(inputFile));
        jScrollPane1.setViewportView(inputTable);

        jLabel1.setText("Peptide Sequences:");

        editPeptideFileButton.setText("Edit");
        editPeptideFileButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                editPeptideFileButtonActionPerformed(evt);
            }
        });

        peptideFileTxt.setEditable(false);

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(peptideFileTxt, javax.swing.GroupLayout.DEFAULT_SIZE, 188, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(editPeptideFileButton)))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(editPeptideFileButton)
                    .addComponent(peptideFileTxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 288, Short.MAX_VALUE)
                .addContainerGap())
        );

        jSplitPane1.setLeftComponent(jPanel1);

        matchingTable.setModel(new ProteinTableModel());
        jScrollPane2.setViewportView(matchingTable);

        jLabel2.setText("Protein Sequences:");

        editProteinFileButton.setText("Edit");
        editProteinFileButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                editProteinFileButtonActionPerformed(evt);
            }
        });

        jTextField1.setEditable(false);

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 396, Short.MAX_VALUE)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jTextField1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(editProteinFileButton)))
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(editProteinFileButton)
                    .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 288, Short.MAX_VALUE)
                .addContainerGap())
        );

        jSplitPane1.setRightComponent(jPanel2);

        jLabel6.setText("MS2 tolerance:");

        ms2ToleranceTxt.setText("0.02");

        jLabel7.setText("Da");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel5)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(separatorTxt, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jLabel3)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(columnSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jLabel4)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(aaSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, 62, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jLabel6)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(ms2ToleranceTxt, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel7)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jButton1)
                .addContainerGap())
            .addComponent(jSplitPane1, javax.swing.GroupLayout.Alignment.TRAILING)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jSplitPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 348, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(columnSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel4)
                    .addComponent(aaSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton1)
                    .addComponent(jLabel5)
                    .addComponent(separatorTxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel6)
                    .addComponent(ms2ToleranceTxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel7))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents

    private void editPeptideFileButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editPeptideFileButtonActionPerformed
        editInputClicked();
    }//GEN-LAST:event_editPeptideFileButtonActionPerformed

    private void editProteinFileButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editProteinFileButtonActionPerformed
        editDBClicked();
    }//GEN-LAST:event_editProteinFileButtonActionPerformed

    private void columnSpinnerMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_columnSpinnerMouseReleased
        updateMatchingTable();
    }//GEN-LAST:event_columnSpinnerMouseReleased

    private void aaSpinnerMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_aaSpinnerMouseReleased
        updateMatchingTable();
    }//GEN-LAST:event_aaSpinnerMouseReleased

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        exportMatches();
    }//GEN-LAST:event_jButton1ActionPerformed
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JSpinner aaSpinner;
    private javax.swing.JSpinner columnSpinner;
    private javax.swing.JButton editPeptideFileButton;
    private javax.swing.JButton editProteinFileButton;
    private javax.swing.JTable inputTable;
    private javax.swing.JButton jButton1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JSplitPane jSplitPane1;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JTable matchingTable;
    private javax.swing.JTextField ms2ToleranceTxt;
    private javax.swing.JTextField peptideFileTxt;
    private javax.swing.JTextField separatorTxt;
    // End of variables declaration//GEN-END:variables
}
